package com.tezign.intelligence.mini.dam.aifamilyconsultant;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.nio.file.Paths;

/**
 * todo
 *
 * @Author ouyangkang
 * @date 2024/11/12
 */

public class DTOGenerator {

	public static void main(String[] args) {
		FastAutoGenerator.create("jdbc:mysql://8.155.0.19:3306/ai_family_consultant", "root", "Kj9#mP2$")
				.globalConfig(builder -> builder
						.author("six")
						.outputDir(Paths.get(System.getProperty("user.dir")) + "/src/main/java")
						.commentDate("yyyy-MM-dd")
				)
				.packageConfig(builder -> builder
						.parent("com.tezign.intelligence.mini.dam.aifamilyconsultant")
						.entity("entity")
						.mapper("mapper")
						.service("service")
						.serviceImpl("service.impl")
						.xml("mapper.xml")
				)
				.strategyConfig(builder -> builder
						.addInclude("user") // 设置需要生成的表名
						.entityBuilder()
						.enableFileOverride()
						.logicDeleteColumnName("status")
						.logicDeletePropertyName("status")
						.enableLombok()
				)
				.templateEngine(new FreemarkerTemplateEngine())
				.execute();
	}
}
